export default {
  type: 'form',
  name: 'system-add-form',
  api: 'post:/upms/admin/system/add',
  canAccessSuperData: false,
  messages: {
    //不展示表单失败信息
    validateFailed: ''
  },
  body: [
    {
      type: 'input-text',
      name: 'systemName',
      label: '名称',
      required: true,
      maxLength: 50,
      validationErrors: {
        isRequired: '请输入名称'
      }
    },
    {
      type: 'group',
      body: [
        {
          type: 'input-number',
          name: 'id',
          label: 'Id',
          max: 99999,
          maxLength: 6,
          required: true,
          validationErrors: {
            isRequired: '请输入Id'
          }
        },
        {
          type: 'input-text',
          name: 'systemCode',
          label: '编码',
          maxLength: 20,
          required: true,
          validationErrors: {
            isRequired: '请输入编码'
          }
        },
      ]
    },
    {
      type: 'input-text',
      name: 'title',
      label: '标题',
      maxLength: 50,
    },
    {
      type: 'input-text',
      name: 'subTitle',
      label: '副标题',
      maxLength: 100,
    },
    {
      type: 'group',
      body: [
        {
          type: 'input-text',
          name: 'basePath',
          label: '系统路径',
          maxLength: 100,
        },
        {
          type: 'input-text',
          name: 'group',
          label: '分组',
          maxLength: 20,
        },
      ]
    },
    {
      type: 'group',
      body: [
        {
          type: 'switch',
          name: 'showInPortal',
          label: 'portal页显示',
          value: '1',
          onText:'是',
          offText:'否',
          required: true,
          validationErrors: {
            isRequired: '请选择portal页显示'
          }
        },
        {
          type: 'input-number',
          name: 'sortNo',
          value: '0',
          label: '排序号',
          max: 999999,
          min: 0,
          maxLength: 6,
          required: true,
          validationErrors: {
            isRequired: '请输入排序号'
          }
        },
      ]
    },
    {
      type: 'group',
      body: [
        {
          type: 'input-image',
          name: 'iconFileUrl',
          label: '子系统icon',
          maxSize: 2097152,
          multiple: false,
          accept: '.jpg,.png,.jpeg,.bmp,.gif',
          receiver: '/base/file/upload?preview=1',
          autoFill: {
            iconFileId: "${fileId}"
          }
        },
        {
          type: 'input-image',
          name: 'bannerFileUrl',
          label: '子系统banner',
          maxSize: 2097152,
          multiple: false,
          accept: '.jpg,.png,.jpeg,.bmp,.gif',
          receiver: '/base/file/upload?preview=1',
          autoFill: {
            bannerFileId: "${fileId}"
          }
        },
        {
          type: 'hidden',
          name: 'iconFileId'
        },
        {
          type: 'hidden',
          name: 'bannerFileId'
        },
      ]
    }
  ]
}